package com.scyshkj.university.wechat.wanxiao;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.scyshkj.university.wechat.utils.ParameterToMap;
import lombok.Data;

/**
 * Created by 唐旭 on 2016/11/28.
 */
@Data
public class WanxiaoAccessTokenRequest implements ParameterToMap {
    private String code;

    @JsonProperty("client_id")
    private String clientId;

    @JsonProperty("client_secret")
    private String clientSecret;

    @JsonProperty("grant_type")
    private String grantType;

    @JsonProperty("redirect_url")
    private String redirectUrl;

    public WanxiaoAccessTokenRequest() {
    }

    public WanxiaoAccessTokenRequest(String code, WanxiaoProperties properties) {
        this.code = code;
        this.clientId = properties.getClientId();
        this.clientSecret = properties.getSec();
        this.grantType = "authorization_code";
        this.redirectUrl = properties.getRedirectUrl();
    }
}
